package com.zyl.Ecs.common.exception;

import com.zyl.Ecs.common.response.ResultCode;
import lombok.*;

/**
 * @version v1.0
 * @ProjectName: Ecs
 * @Package: com.zyl.Ecs.common.exception
 * @ClassName: EcsException
 * @Description TODO (自定义异常类)
 * @Author 翟玉龙
 * @Date 2024/12/4-11:29
 */
@Getter
public class EcsException extends RuntimeException {

    private int code;

    public EcsException(String message) {
        super(message);
    }

    public EcsException(int code, String message) {
        super(message);
        this.code = code;
    }

    public EcsException(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
    }

}